<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>promise链式调用</title>
</head>
<body>
    
</body>
<script>
    let api = new Promise((resolve,reject)=>{
        setTimeout(() => {
            if(true){    
                resolve(100000)  
            }else{
                reject()   
            }
        }, 1000);
    });


    api.then((res)=>{
        console.log("今年的奖金",res);
        // 如果return 非promise类型 pending => fulfilled
        // 如果return promise类型 根据这个新的promise对象的结果决定 fulfilled/rejected
        return res + 10000
    })
    .then((res)=>{
        console.log("明年的奖金",res)
    })
    .catch(()=>{})
</script>
</html>